<template>
	<view>
		<view class="echange_box">
			<view class="echange" @click="allocation(1)">

				<image src="@/static/x_tb.png" mode=""></image><text>向下调拨</text>
			</view>
			<view class="echange" @click="allocation(2)">

				<image src="@/static/h_tb.png" mode=""></image><text>回拨</text>
			</view>
			<view class="echange" @click="all_record(1,'接收列表')">

				<image src="@/static/tb_sz.png" mode=""></image><text>接收列表</text>
			</view>
			<view class="echange" @click="all_record(2,'调拨列表')">

				<image src="@/static/tbsz.png" mode=""></image><text>调拨列表</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id: null
			}
		},
		onLoad(e) {
			this.id = e.id
		},
		methods: {
			allocation(e) {
				uni.navigateTo({
					url: '/pages/index/exchange/exchange?type=' + e + '&id=' + this.id
				})
			},
			all_record(e, tit) {
				uni.navigateTo({
					url: '/pages/index/exchange/allrecord?type=' + e + '&tit=' + tit + '&id=' + this.id
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.echange_box {
		padding: 30rpx;
		display: flex;
		flex-wrap: wrap;
		justify-content: space-between;

		.echange {
			width: 47%;
			height: 200rpx;
			padding: 20rpx;
			box-sizing: border-box;
			border-radius: 15rpx;
			margin-bottom: 30rpx;
			color: #fff;
			font-size: 32rpx;
			display: flex;
			flex-direction: column;
			justify-content: space-between;

			// align-items: flex-end;
			text {
				display: block;
				width: 100%;
				text-align: start;
			}

			image {
				width: 60rpx;
				height: 60rpx;
			}
		}

		.echange:nth-child(5n+1) {
			background-image: linear-gradient(to right, #ff8043, #fea759);
		}

		.echange:nth-child(5n+2) {
			background-image: linear-gradient(to right, #756bff, #756bff);
		}

		.echange:nth-child(5n+3) {
			background-image: linear-gradient(to right, #318efe, #29adff);
		}

		.echange:nth-child(5n+4) {
			background-image: linear-gradient(to right, #fe5d5c, #ff9192);
		}

		.echange:nth-child(5n+5) {
			background-image: linear-gradient(to right, #74d284, #81ea93);
		}
	}
</style>